package com.ln.第二遍1105.demo02;

import java.util.Arrays;
import java.util.stream.Stream;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/5 19:05
 */
public class Test01 {
    public static void main(String[] args) {
        String[] arr1 = { "a", "b", "c", "d" };
        String[] arr2 = { "d", "e", "f", "g" };
        Stream<String> stream1 = Arrays.stream(arr1);
        Stream<String> stream2 = Stream.of(arr2);

//       Stream.concat(stream1,stream2).forEach(System.out::println);

//       Stream.concat(stream1,stream2).distinct().forEach(System.out::println);
        //limit取前几个
//       Stream.concat(stream1,stream2).distinct().limit(2).forEach(System.out::println);
        //skip跳过几个
       Stream.concat(stream1,stream2).distinct().skip(2).forEach(System.out::println);
    }
}
